<template>
  <div class="parent">
    <h1>provide-inject</h1>
    <child />
  </div>
</template>

<script>
import child from "./child.vue";
export default {
  components: {
    child
  },
  provide() {
    return {
      title: this.title,
      handle: this.handle
    };
  },
  data() {
    return {
      title: "this is parent title"
    };
  },
  methods: {
    handle() {
      console.log(this.title);
    }
  }
};
</script>
